package cn.lili.xiaoran.entity.dtos;


import java.util.Date;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import cn.lili.common.vo.PageVO;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

/**
 * 提问表(LiQuestions)实体类
 *
 * @author makejava
 * @since 2022-08-11 21:33:50
 */
@Data
@JsonNaming(value = PropertyNamingStrategy.SnakeCaseStrategy.class)
public class LiQuestionsDTO extends PageVO {
    private static final long serialVersionUID = -15601237944571032L;
    private Integer id;
    private String createBy;
    private Date createTime;
    private Boolean deleteFlag;
    private String updateBy;
    private Date updateTime;
    private String title;
    private String content;
    private String createUserName;
    private String createUserHread;
    private Boolean isRenzheng;
    private Integer industryId;
    private Boolean isXuanshang;
    private Double xianshengjine;
    private Long appointUser;
    private String userId;
    private Integer chakannum;
    private Integer isAll;

    public <T> QueryWrapper<T> queryWrapper() {
        QueryWrapper<T> queryWrapper = new QueryWrapper<>();
        if (id != null) {
            queryWrapper.eq("id", id);
        }

        if (title != null) {
            queryWrapper.eq("title", title);
        }
        if (content != null) {
            queryWrapper.eq("content", content);
        }

        if (isRenzheng != null) {
            queryWrapper.eq("is_renzheng", isRenzheng);
        }
        if (industryId != null) {
            queryWrapper.eq("industry_id", industryId);
        }
        if (isXuanshang != null) {
            queryWrapper.eq("is_xuanshang", isXuanshang);
        }
        if (xianshengjine != null) {
            queryWrapper.eq("xianshengjine", xianshengjine);
        }
        if (appointUser != null) {
            queryWrapper.eq("appointUser", appointUser);
        }
        if (userId != null) {
            queryWrapper.eq("user_id", userId);
        }
        if(chakannum != null) {
            queryWrapper.eq("chakannum", chakannum);
        }
        queryWrapper.eq("delete_flag", 0);
        if(deleteFlag != null) {
            queryWrapper.eq("delete_flag", deleteFlag);
        }
        if(isAll!=null){
            if(isAll==2){
                queryWrapper.eq("isweidu", 1);
            }
        }
        return queryWrapper;
    }
}

